﻿using BUGCOME.Model;
using BUGCOME.Model.Auth.dto;
using BUGCOME.Service.Auth.IServices;
using Microsoft.AspNetCore.Mvc;

namespace BUGCOME.Auth.Api.Controllers
{
    /// <summary>
    /// 路由管理API控制器
    /// </summary>
    [Route("authapi/[controller]/[action]")]
    [ApiController]
   
    public class UserMsgController : BaseController
    {
        // 用户消息服务接口实例
        private readonly IUserMsgService userMsgService;

        /// <summary>
        /// 构造函数，通过依赖注入初始化用户消息服务
        /// </summary>
        /// <param name="userMsgService">用户消息服务接口实例，用于提供用户消息相关的业务逻辑处理能力，通过依赖注入实现解耦 </param>
        public UserMsgController(IUserMsgService userMsgService)
        {
            this.userMsgService = userMsgService;
        }

        /// <summary>
        /// 获取用户消息
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<IActionResult> GetMyUserMsgList([FromBody] UserMsgQueryDto dto)
        {
            var response = await userMsgService.GetListAsync(dto);
            return Success(response);
        }
    }
}
